<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>chocolate品牌网站-网站管理</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="public/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="public/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <script src="public/js/echarts.min.js"></script>
    <link rel="stylesheet" href="public/css/amazeui.min.css" />
    <link rel="stylesheet" href="public/css/amazeui.datatables.min.css" />
    <link rel="stylesheet" href="public/css/app.css">
    <script src="public/js/jquery.min.js"></script>

</head>
<body data-type="index">
<script src="public/js/theme.js"></script>
<div class="am-g tpl-g">
    <!-- 头部 -->
    <header>
        <!-- logo -->
        <div class="am-fl tpl-header-logo">
            <a href="admin.php"><img src="public/img/logo.png" width="450" alt=""></a>
        </div>
        <!-- 右侧内容 -->
        <div class="tpl-header-fluid">
            <!-- 侧边切换 -->
            <div class="am-fl tpl-header-switch-button am-icon-list">
                    <span>

                </span>
            </div>
            <!-- 搜索 -->
            <div class="am-fl tpl-header-search">

            </div>
            <!-- 其它功能-->
            <div class="am-fr tpl-header-navbar">
                <ul>
                    <!-- 欢迎语 -->
                    <li class="am-text-sm tpl-header-navbar-welcome">
                        <a href="javascript:;">欢迎你, <span><?php echo ($_SESSION['adminUser']['username']); ?></span> </a>
                    </li>

                    <!-- 退出 -->
                    <li class="am-text-sm">
                        <a href="admin.php?c=login&a=loginout">
                            <span class="am-icon-sign-out"></span> 退出
                        </a>
                    </li>
                </ul>
            </div>
        </div>

    </header>
    <!-- 风格切换 -->
    <div class="tpl-skiner">
        <div class="tpl-skiner-toggle am-icon-cog">
        </div>
        <div class="tpl-skiner-content">
            <div class="tpl-skiner-content-title">
                选择主题
            </div>
            <div class="tpl-skiner-content-bar">
                <span class="skiner-color skiner-white" data-color="theme-white"></span>
                <span class="skiner-color skiner-black" data-color="theme-black"></span>
            </div>
        </div>
    </div>
<!-- 侧边导航栏 -->
<div class="left-sidebar">
  <!-- 用户信息 -->
  <div class="tpl-sidebar-user-panel">
    <div class="tpl-user-panel-slide-toggleable">
      <div class="tpl-user-panel-profile-picture">
        <img src="<?php echo ($_SESSION['adminUser']['thumb']); ?>" width="82" height="82" alt="<?php echo ($_SESSION['adminUser']['username']); ?>">
      </div>
                    <span class="user-panel-logged-in-text">
              <i class="am-icon-circle-o am-text-success tpl-user-panel-status-icon"></i>
                      <?php echo ($_SESSION['adminUser']['username']); ?>
          </span>
      <a href="admin.php?c=admin&a=edit&id=<?php echo ($_SESSION['adminUser']['id']); ?>" class="tpl-user-panel-action-link"> <span class="am-icon-pencil"></span> 账号设置</a>
    </div>
  </div>

  <!-- 菜单 -->
  <ul class="sidebar-nav">
    <li class="sidebar-nav-link">
      <a href="admin.php" <?php if(CONTROLLER_NAME == Index): ?>class="active"<?php endif; ?>>
      <i class="am-icon-home sidebar-nav-link-logo"></i> 首页
      </a>
    </li>
    <li class="sidebar-nav-link">
      <a href="admin.php?c=category" <?php if(CONTROLLER_NAME == Category): ?>class="active"<?php endif; ?>>
      <i class="am-icon-tags sidebar-nav-link-logo"></i> 分类管理
      </a>
    </li>
    <li class="sidebar-nav-link">
      <a href="admin.php?c=product" <?php if(CONTROLLER_NAME == Product): ?>class="active"<?php endif; ?>>
      <i class="am-icon-inbox sidebar-nav-link-logo"></i> 产品管理
      </a>
    </li>
    <li class="sidebar-nav-link">
      <a href="admin.php?c=admin" <?php if(CONTROLLER_NAME == Admin): ?>class="active"<?php endif; ?>>
        <i class="am-icon-user sidebar-nav-link-logo"></i> 用户管理
      </a>
    </li>
    <li class="sidebar-nav-link">
      <a href="admin.php?c=Message" <?php if(CONTROLLER_NAME == Message): ?>class="active"<?php endif; ?>>
        <i class="am-icon-info sidebar-nav-link-logo"></i> 留言管理
      </a>
    </li>
    <li class="sidebar-nav-link">
      <a href="admin.php?c=about" <?php if(CONTROLLER_NAME == About): ?>class="active"<?php endif; ?>>
      <i class="am-icon-info sidebar-nav-link-logo"></i> 关于我们
      </a>
    </li>
    <li class="sidebar-nav-link">
      <a href="admin.php?c=setting" <?php if(CONTROLLER_NAME == Setting): ?>class="active"<?php endif; ?>>
      <i class="am-icon-gear sidebar-nav-link-logo"></i> 网站设置
      </a>
    </li>
  </ul>
</div>
<!-- 内容区域 -->
<!-- 内容区域 -->
<div class="tpl-content-wrapper">
    <div class="row-content am-cf">
        <div class="row">
            <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                <div class="widget am-cf">
                    <div class="widget-head am-cf">
                        <div class="widget-title  am-cf">产品列表</div>


                    </div>
                    <div class="widget-body  am-fr">
                        <form action="admin.php" method="get">
                        <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                            <div class="am-form-group">
                                <div class="am-btn-toolbar">
                                    <div class="am-btn-group am-btn-group-xs">
                                        <button type="button" class="am-btn am-btn-default am-btn-success" id="button-add"><span class="am-icon-plus"></span> 新增</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                            <div class="am-form-group tpl-table-list-select">
                                <select data-am-selected="{btnSize: 'sm'}" name="catid">
                                    <option value="0">所有类型</option>
                                    <?php if(is_array($catelsit)): $i = 0; $__LIST__ = $catelsit;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$catelist): $mod = ($i % 2 );++$i;?><option value="<?php echo ($catelist["id"]); ?>" ><?php echo ($catelist["catname"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                </select>
                            </div>
                        </div>
                        <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                            <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                <input type="text" class="am-form-field " name="title">
                                        <span class="am-input-group-btn">
            <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" id="sub_data" type="submit"></button>
          </span>
                            </div>
                        </div>
                            <input type="hidden" name="c" value="product"/>
                            <input type="hidden" name="a" value="index"/>
                        </form>
                        <div class="am-u-sm-12">
                            <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black missj-table">
                                <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>产品缩略图</th>
                                    <th>产品名称</th>
                                    <th>货号</th>
                                    <th>类型</th>
                                    <th>材质</th>
                                    <th>工艺</th>
                                    <th>发型</th>
                                    <th>发布时间</th>
                                    <th>更新时间</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php if(is_array($product)): $i = 0; $__LIST__ = $product;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$pro): $mod = ($i % 2 );++$i;?><tr class="gradeX">
                                    <td class="am-text-middle"><?php echo ($pro["id"]); ?></td>
                                    <td>
                                        <img src="<?php echo ($pro["thumb"]); ?>" width="60" height="40" class="tpl-table-line-img" alt="">
                                    </td>
                                    <td class="am-text-middle"><a href="index.php?c=product&a=detail&id=<?php echo ($pro["id"]); ?>" target="_blank"><?php echo ($pro["pname"]); ?></a></td>
                                    <td class="am-text-middle"><?php echo ($pro["code"]); ?></td>
                                    <td class="am-text-middle"><?php echo (getcatname($catelsit,$pro["catid"])); ?></td>
                                    <td class="am-text-middle"><?php echo (getmaterialById($pro["material"])); ?></td>
                                    <td class="am-text-middle"><?php echo (gettechbyid($pro["tech"])); ?></td>
                                    <td class="am-text-middle"><?php echo (getmodelbyid($pro["model"])); ?></td>
                                    <td class="am-text-middle"><?php echo (date("Y-m-d H:i",$pro["inputtime"])); ?></td>
                                    <td class="am-text-middle"><?php echo (date("Y-m-d H:i",$pro["updatetime"])); ?></td>
                                    <td class="am-text-middle">
                                        <div class="tpl-table-black-operation">
                                            <a href="javascript:void(0)" id="missj-edit" attr-id="<?php echo ($pro['id']); ?>">
                                                <i class="am-icon-pencil"></i> 编辑
                                            </a>
                                            <a href="javascript:void(0)" id="missj-delete"  attr-id="<?php echo ($pro["id"]); ?>" attr-message="删除" class="tpl-table-black-operation-del">
                                                <i class="am-icon-trash"></i> 删除
                                            </a>
                                        </div>
                                    </td>
                                </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                                <!-- more data -->
                                </tbody>
                            </table>
                        </div>
                        <div class="am-u-lg-12 am-cf">

                            <div class="am-fr">
                                <?php echo ($pageres); ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</div>
<script>
    var SCOPE = {
        'edit_url' : 'admin.php?c=product&a=edit',
        'add_url' : 'admin.php?c=product&a=add',
        'set_status_url' : 'admin.php?c=product&a=setStatus',
        'sing_news_view_url' : 'index.php?c=view',
        'listorder_url' : 'admin.php?c=product&a=listorder',
        'push_url' : 'admin.php?c=product&a=push',
    }
</script>
<script src="public/js/amazeui.min.js"></script>
<script src="public/js/amazeui.datatables.min.js"></script>
<script src="public/js/dataTables.responsive.min.js"></script>
<script src="public/js/app.js"></script>

<script src="Public/js/dialog/layer.js"></script>
<script src="Public/js/dialog.js"></script>
<script src="Public/js/party/jquery.uploadify.js"></script>
<script src="Public/js/admin/common.js"></script>
<div id="tpl-echarts"></div>
</body>

</html>